package com.doraro.coal.moudle.purch.controller;


import com.doraro.coal.exception.R;
import com.doraro.coal.moudle.purch.entity.PurchAudit;
import com.doraro.coal.moudle.purch.service.IPurchAuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author doraro
 * @since 2019-10-08
 */
@RestController
@RequestMapping("/purchAudit")
public class PurchAuditRestController {
    @Autowired
    private IPurchAuditService purchAuditService;

    @GetMapping("/list")
    public R<List<PurchAudit>> getAudits(@RequestParam String purchId){
        final List<PurchAudit> list = purchAuditService.lambdaQuery()
                .eq(PurchAudit::getPurchApplyId, purchId)
                .list();
        return R.success(list);
    }


}

